package com.tencreat.mapper.mall;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tencreat.domain.mall.MallGoodsCollage;
import com.tencreat.domain.mall.dto.MallGoodsCollageDTO;
import com.tencreat.domain.mall.dto.MallGoodsRecordDTO;
import com.tencreat.domain.mall.vo.MallGoodsCollageRecordVo;
import com.tencreat.domain.mall.vo.ResGoodsCollageDetailVO;
import com.tencreat.domain.mall.vo.ResGoodsCollageListAppVO;
import com.tencreat.domain.mall.dto.GoodsCollageListAppDTO;
import com.tencreat.domain.mall.vo.MallGoodsCollageVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 商品拼团Mapper接口
 *
 * @author tencreat
 * @date 2022-01-24
 */
public interface MallGoodsCollageMapper extends BaseMapper<MallGoodsCollage> {

    Page<MallGoodsCollageVO> PCPage(IPage<?> page , @Param("param")MallGoodsCollageDTO dto);

    MallGoodsCollageVO getDetail(@Param("id") Long id);

    Page<ResGoodsCollageListAppVO> appPage(Page<ResGoodsCollageListAppVO> page, @Param("vo") GoodsCollageListAppDTO vo, @Param("now") LocalDateTime now);

    ResGoodsCollageDetailVO getGoodsCollageDetailById(@Param("id")Long id);

    List<ResGoodsCollageListAppVO> getMyCollage(@Param("uuid")Long uuid, @Param("collageStatus") Long collageStatus);

    /**
     *
     * @param type 类型 1|拼团成功 2|拼团失败
     * @param day 当天日期
     * @return
     */
    BigDecimal collageCount(@Param("type") Integer type,  @Param("day") LocalDateTime day);

    IPage<MallGoodsCollageRecordVo> collageRecord(IPage<?> iPage, @Param("param") MallGoodsRecordDTO dto);
}
